//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//// PARTICULAR PURPOSE.
////
//// Copyright (c) Microsoft Corporation. All rights reserved.

//namespace Microsoft.Samples.Commerce.Order.CommerceEntities
//{
//    using Microsoft.Commerce.Contracts;

//    /// <summary>
//    /// Represents a category in a catalog.
//    /// </summary>
//    public class Category : HierarchicalCatalogEntity
//    {
//        /// <summary>
//        /// defines the model name for this commerce entity
//        /// </summary>
//        public new const string ModelNameDefinition = "Category";

//        /// <summary>
//        /// Initializes a new instance of the <see cref="Category"/> class.
//        /// </summary>
//        public Category() : base()
//        {
//            this.CommerceEntity = new CommerceEntity(Category.ModelNameDefinition);
//        }

//        /// <summary>
//        /// Initializes a new instance of the <see cref="Category"/> class.
//        /// </summary>
//        /// <param name="commerceEntity">The commerce entity.</param>
//        public Category(CommerceEntity commerceEntity)
//            : base(commerceEntity)
//        {
//            this.CommerceEntity = commerceEntity;
//        }

//        /// <summary>
//        /// Gets or sets the is searchable.
//        /// </summary>
//        /// <value>The is searchable.</value>
//        public bool? IsSearchable
//        {
//            get
//            {
//                return (bool?)this.CommerceEntity.GetPropertyValue(PropertyName.IsSearchable);
//            }

//            set
//            {
//                this.CommerceEntity.SetPropertyValue(PropertyName.IsSearchable, value ?? null);
//            }
//        }

//        /// <summary>
//        /// Gets or sets the child categories in this category
//        /// </summary>
//        /// <value>a list of Relationships where the target is of type Category.</value>
//        /// <remarks>This is an optional property.</remarks>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Collection setting is required")]
//        public CommerceRelationshipList ChildCategories
//        {
//            get
//            {
//                return this.CommerceEntity.GetPropertyValue(RelationshipName.ChildCategories) as CommerceRelationshipList;
//            }

//            set
//            {
//                this.CommerceEntity.SetPropertyValue(RelationshipName.ChildCategories, value);
//            }
//        }

//        /// <summary>
//        /// Gets or sets the category hierarchy in this category
//        /// </summary>
//        /// <value>a list of Relationships where the target is of type Category.</value>
//        /// <remarks>This is an optional property.</remarks>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Collection setting is required")]
//        public CommerceRelationshipList CategoryHierarchy
//        {
//            get
//            {
//                return this.CommerceEntity.GetPropertyValue(RelationshipName.CategoryHierarchy) as CommerceRelationshipList;
//            }

//            set
//            {
//                this.CommerceEntity.SetPropertyValue(RelationshipName.CategoryHierarchy, value);
//            }
//        }

//        /// <summary>
//        /// Gets or sets the child products.
//        /// </summary>
//        /// <value>a list of Relationships where the target is of type Product.</value>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Collection setting is required")]
//        public CommerceRelationshipList ChildProducts
//        {
//            get
//            {
//                return this.CommerceEntity.GetPropertyValue(RelationshipName.ChildProducts) as CommerceRelationshipList;
//            }

//            set
//            {
//                this.CommerceEntity.SetPropertyValue(RelationshipName.ChildProducts, value);
//            }
//        }

//        #region Implicit operators
//        /// <summary>
//        /// Toes the user profile.
//        /// </summary>
//        /// <param name="commerceEntity">The commerce entity.</param>
//        /// <returns></returns>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Design decision for API")]
//        public static implicit operator Category(CommerceEntity commerceEntity)
//        {
//            System.Diagnostics.Debug.Assert(Category.ModelNameDefinition.Equals(commerceEntity.ModelName), "Unexpected model name");
//            return new Category(commerceEntity);
//        }
//        #endregion

//        /// <summary>
//        /// Names of the properties exposed by this commerce entity.
//        /// </summary>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Needed for external access"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1053:StaticHolderTypesShouldNotHaveConstructors", Justification = "Cannot make it private as it cannot be derived from")]
//        public new class PropertyName : HierarchicalCatalogEntity.PropertyName
//        {
//            /// <summary>
//            /// The name of the IsSearchable property.
//            /// </summary>
//            public const string IsSearchable = "IsSearchable";
//        }

//        /// <summary>
//        /// Class defining Properties of Items that may be related to a Category.
//        /// </summary>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", Justification = "Required because of API specification (i.e. DataContract design)")]
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Needed for external access"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1053:StaticHolderTypesShouldNotHaveConstructors", Justification = "Cannot make it private as it cannot be derived from")]
//        public new class RelationshipName : HierarchicalCatalogEntity.RelationshipName
//        {
//            /// <summary>
//            /// The name of the ChildCategories property for an item related to a Category.
//            /// </summary>
//            public const string ChildCategories = "ChildCategories";

//            /// <summary>
//            /// The name of the ChildProducts property for an item related to a Category.
//            /// </summary>
//            public const string ChildProducts = "ChildProducts";

//            /// <summary>
//            /// The name of the CategoryHierarchy property for an item related to a Category.
//            /// </summary>
//            public const string CategoryHierarchy = "CategoryHierarchy";
//        }
//    }
//}
